import React, { useState } from 'react';
import {Outlet}from 'react-router-dom'
import './index.css'
import {
  MenuFoldOutlined,
  MenuUnfoldOutlined,
  UploadOutlined,
  UserOutlined,
  VideoCameraOutlined,
} from '@ant-design/icons';
import CommonAsilder from '../components/commonAsilder'
import CommonHeader from '../components/commonHeader'
import { Button, Layout, Menu, theme } from 'antd';
import {useSelector} from 'react-redux'

const { Header, Sider, Content } = Layout;

export default function Main() {
  // const [collapsed, setCollapsed] = useState(false);
  const collapsed=useSelector(state=>state.tab.isCollapsed)
  const {
    token: { colorBgContainer, borderRadiusLG },
  } = theme.useToken();
  return (
    <div>
 <Layout className='layout'>
<CommonAsilder collapsed={collapsed}/>
      <Layout>
        <CommonHeader className='header' collapsed={collapsed}></CommonHeader>
        <Content
          style={{
            margin: '24px 16px',
            padding: 24,
            minHeight: 280,
            background: colorBgContainer,
            borderRadius: borderRadiusLG,
          }}
        >
          Content
        </Content>
      </Layout>
    </Layout>
      
      <Outlet/>
    </div>
  )
}
